<%--
  Created by IntelliJ IDEA.
  User: v.tsapaev
  Date: 26.05.12
  Time: 13:07
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://www.springframework.org/security/tags" prefix="sec" %>
<html>
<head>
    <title></title>
    <link type="text/css" rel="stylesheet" href="../resources/css/index.css">
    <script type="text/javascript" language="javascript" src="../resources/js/util/jquery-1.7.2.js"></script>
    <script type="text/javascript" language="javascript" src="../resources/js/index.js" charset="UTF-8"></script>
</head>
<body>
    <div id="container">
        <c:import url="header.jsp"/>

        <div class="center-container">
            <table class="table-center">
                <c:choose>
                    <c:when test="${not empty orderList}">
                        <sec:authorize access="hasRole('ROLE_ADMIN')">
                            <th><div>Пользователь</div></th>
                        </sec:authorize>
                        <th><div>заказ №</div></th>
                        <th><div></div></th>
                        <c:forEach var="order" items="${orderList}">

                            <tr>
                                <sec:authorize access="hasRole('ROLE_ADMIN')">
                                    <td><div>${order.owner.username}</div></td>
                                </sec:authorize>
                                <td><div>${order.orderId}</div></td>
                                <td><div></div></td>
                            </tr>
                        </c:forEach>
                    </c:when>

                    <c:otherwise>
                        <tr><td><div>Покупок совершено не было</div></td></tr>
                    </c:otherwise>
                </c:choose>
            </table>
        </div>
    </div>
</body>
</html>